﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace LdtJudge.DataEngine.Model.XMLConfigModel.DataSave
{
    [Serializable]
    [XmlRootAttribute("root", IsNullable = false)]
    public class ReorderModel
    {
        [XmlElementAttribute("casetype", IsNullable = false)]
        public List<CaseTypeModel> caseTypeModelList { get; set; }
    }

    public class OrderNodeModel 
    {
        [XmlAttribute("name")]
        public string name { get; set; }
        [XmlAttribute("xmlpath")]
        public string xmlpath { get; set; }

        [XmlElementAttribute("condition", IsNullable = false)]
        public List<ConditionModel> conditionModelList { get; set; }
    }

    public class CaseTypeModel 
    {
        [XmlAttribute("code")]
        public string code { get; set; }

        [XmlElementAttribute("node", IsNullable = false)]
        public List<OrderNodeModel> orderNodeModelList { get; set; }
    }

    public class ConditionModel 
    {
        [XmlAttribute("elementname")]
        public string elementname { get; set; }

        [XmlAttribute("order")]
        public string order { get; set; }
        [XmlAttribute("type")]
        public string type { get; set; }

        [XmlElementAttribute("valuelist", IsNullable = false)]
        public List<ValelistModel> valelistModelList { get; set; }
        [XmlElementAttribute("condition", IsNullable = false)]
        public List<ConditionModel> conditionModelList { get; set; }
    }

    public class ValelistModel 
    {
        [XmlAttribute("number")]
        public string number { get; set; }
        [XmlAttribute("value")]
        public string value { get; set; }
    }
}
